(compilation-filter): New function.
authorRoland McGrath <roland@gnu.org>
Wed, 7 Apr 1993 18:34:17 +0000 (18:34 +0000)
committerRoland McGrath <roland@gnu.org>
Wed, 7 Apr 1993 18:34:17 +0000 (18:34 +0000)
(compile-internal): Make it the process's filter.

lisp/progmodes/compile.el

index ec2ef2b72665211c1697b66981521a36c0e273c0..ab942de603d7842935d60dc95130436055382d9a 100644 (file)
@@ -321,6 +321,7 @@ Returns the compilation buffer created."
                                               outbuf
                                               command)))
        (set-process-sentinel proc 'compilation-sentinel)
+       (set-process-filter proc 'compilation-filter)
        (setq compilation-in-progress (cons proc compilation-in-progress))))
     ;; Make it so the next C-x ` will use this buffer.
     (setq compilation-last-buffer outbuf)))
@@ -404,6 +405,17 @@ Runs `compilation-mode-hook' with `run-hooks' (which see)."
          (setq compilation-in-progress (delq proc compilation-in-progress))
          ))))
 
+(defun compilation-filter (proc string)
+  "Process filter for compilation buffers.
+Just inserts the text, but uses insert-before-markers."
+  (save-excursion
+    (set-buffer (process-buffer proc))
+    (let ((buffer-read-only nil))
+      (save-excursion
+       (goto-char (process-mark proc))
+       (insert-before-markers string)
+       (set-marker (process-mark proc) (point))))))
+
 ;; Return the cdr of compilation-old-error-list for the error containing point.
 (defun compile-error-at-point ()
   (compile-reinitialize-errors nil (point))